package main

import "fmt"

type Student struct {
	Name string
	Age  int
}

// func (s Student) test() {
// 	s.Name = "李四"
// 	fmt.Println(s.Name, s.Age)
// }

func (s *Student) test() {
	s.Name = "李四"
	fmt.Println(s.Name, s.Age)
}

func main() {
	var s1 Student = Student{"张三", 18}
	s1.test()
	fmt.Println(s1.Name, s1.Age)
}
